<template>
  <div class="childCard">
    <a-card>
      <a-row>
        <a-form>
          <a-col span="6">
            <a-form-item
                :label="label"
                :label-col="{span:6}"
                :wrapper-col="{span:18}"
            >
              <a-input-search
                  allowClear
                  placeholder="input search text"
                  style="width: 200px"
                  @search="onSearch"
              />
            </a-form-item>
          </a-col>
          <a-col span="6">
            <a-form-item>
              <a-button
                  type="primary"
                  @click="add"
              >
                新建
              </a-button>
            </a-form-item>
          </a-col>
        </a-form>
      </a-row>
    </a-card>
  </div>
</template>

<script>
export default {
  name: "PublicHead",
  props: {
    label: {
      type: String,
      required: true
    },
    onSearch: {
      type: Function,
      required: true
    },
    add: {
      type: Function,
      required: true
    }
  }
}
</script>

<style scoped>
.childCard >>> .ant-card-body {
  padding: 5px 0px !important;
}

.childCard >>> .ant-form-item {
  margin-bottom: 0px;
}
</style>
